<%
  names = @user.attribute_names(true) - ["objectClass", "userPassword"]
  required_attributes = @user.must.collect(&:name)
%>

<h3><%= _("Update attributes") %></h3>

<table class="values form">
  <thead>
    <tr>
      <th><%= _("attribute name") %></th>
      <th><%= _("value") %></th>
      <th><%= _("description") %></th>
    </tr>
  </thead>

<% names.sort.each do |name| -%>
  <tr class="<%= cycle('even', 'odd') %>">
    <th scope="row">
      <label for="user_<%=h name %>"><%= h la_(name) %></label>
      <%= link_to("?", attribute_url_for_options(name)) %>
<%   if required_attributes.include?(name) -%>
      <span class="required-attribute-mark">*</span>
<%   end -%>
    </th>
    <td>
       <%=
          ldap_field(:text, :user, name,
                     :ldap_options => ["lang-en"]) do |field, info|
            ldap_options = info[:options]
            if ldap_options.empty?
              "#{field}<br />"
            else
              "#{ldap_options.join(';')}: #{field}<br />"
            end
          end
       -%>
    </td>
    <td><%= h lad_(name) %></td>
  </tr>
<% end -%>
</table>
